<?php
namespace App\Edu\Providers;

use App\Edu\Facades\EduCourseFacade;
use App\Edu\Facades\EduFacade;
use App\Edu\Facades\EduPaperFacade;
use App\Edu\Facades\EduQuestionFacade;
use App\Edu\Models\EduCourseModel;
use App\Edu\Models\EduPaperModel;
use App\Edu\Models\EduQuestionModel;
use App\Edu\Services\EduCourseService;
use App\Edu\Services\EduPaperService;
use App\Edu\Services\EduQuestionService;
use App\Edu\Services\EduService;
use App\Providers\EventServiceProvider;

//EloquentUserProvider
class EduProvider extends EventServiceProvider
{

    /**
     * 注册绑定门面
     */
    public function register()
    {
        $this->app->bind(EduFacade::class, function () {
            return app()->make(EduService::class);
        });

        $this->app->bind(EduCourseService::class, function () {
            return new EduCourseService(new EduCourseModel());
        });
        $this->app->bind(EduCourseFacade::class, function () {
            return app()->make(EduCourseService::class);
        });

        $this->app->bind(EduPaperService::class, function () {
            return new EduPaperService(new EduPaperModel());
        });
        $this->app->bind(EduPaperFacade::class, function () {
            return app()->make(EduPaperService::class);
        });

        
        $this->app->bind(EduQuestionService::class, function () {
            return new EduQuestionService(new EduQuestionModel());
        });
        $this->app->bind(EduQuestionFacade::class, function () {
            return app()->make(EduQuestionService::class);
        });
    }
}
